<%@ page language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/jsp/taglibs.jsp" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib uri="http://www.framework.com/taglib/tree" prefix="tree" %>
<%@taglib prefix="frame" uri="http://www.framework.com/taglib" %>
<html>
<head>
    <title>公共平台 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 样式文件的引入 -->
    <link href="${ctx}/commons/css/style.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/icon.css">
    <link href="${ctx}/commons/js/uploadify/uploadify.css" rel="stylesheet" type="text/css"/>

    <!-- jqueryUI JS文件的引入 -->
    <script type="text/javascript" src="${ctx}/commons/js/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="${ctx}/commons/js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${ctx}/commons/js/easyui-extends-validate.js"></script>
    <script type="text/javascript" src="${ctx}/commons/js/uploadify/jquery.uploadify.min.js"></script>
    <!-- jqueryUI国际化 -->
    <script type="text/javascript" src="${ctx}/commons/js/easyui-lang-zh_CN.js"></script>
    <!-- 开发使用的公用js方法 -->
    <script type="text/javascript" src="${ctx}/commons/js/common.js"></script>
    <!-- 开发国际化的引用，主要完成后台信息在前台提示的国际化，一定要放在最后 -->
    <script type="text/javascript">var ctx = '${ctx}';
    var actionExt = "action";
    var i18n = new Object();</script>
    <script src="${ctx}/commons/js/i18n/message_zh_CN.js" type="text/javascript"></script>
</head>

<body>
<form name="addDataForm" id="addDataSetForm" action="${ctx}/framework/dataset/save">
    <input type="hidden" name="id" value="${dataSet.id}"/>
    <fieldset style="width:80%;margin:0 auto;padding: 10px;">
        <legend>集中采购机构信息</legend>
        <table class="infoTable">
            <tbody>
            <tr>
                <th align="right" width="10%">机构名称:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.procurementName}" name="procurementName" id="procurementName"
                           size="50" maxlength="100" class="easyui-validatebox"/>
                </td>
                <th align="right" width="10%">机构网址:</th>
                <td>
                    <input type="text" value="${dataSet.procurementUrl}" name="procurementUrl" id="procurementUrl"
                           size="50" maxlength="100" class="easyui-validatebox"/>
                </td>
            </tr>
            <tr>
                <th>机构地址:</th>
                <td>
                    <input type="text" value="${dataSet.procurementAddr}" name="procurementAddr" id="procurementAddr"
                           size="50" maxlength="100" class="easyui-validatebox"/>
                </td>
            </tr>
            </tbody>
        </table>
    </fieldset>
    <fieldset style="width:80%;margin:0 auto;padding: 10px;">
        <legend>保证金账户信息</legend>
        <table class="infoTable">
            <tbody>
            <tr>
                <th align="right" width="10%">户名:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.cashDepositName}" name="cashDepositName" id="cashDepositName"
                           size="50" maxlength="100" class="easyui-validatebox"/>
                </td>
                <th align="right" width="10%">账号:</th>
                <td>
                    <input type="text" value="${dataSet.cashDepositAccount}" name="cashDepositAccount"
                           id="cashDepositAccount" size="50" maxlength="100" class="easyui-validatebox"/>
                </td>
            </tr>
            <tr>
                <th>开户行:</th>
                <td>
                    <input type="text" value="${dataSet.cashDepositBank}" name="cashDepositBank" id="cashDepositBank"
                           size="50" maxlength="100" class="easyui-validatebox"/>
                </td>
            </tr>
            </tbody>
        </table>
    </fieldset>
    <fieldset style="width:80%;margin:0 auto;padding: 10px;">
        <legend>主办单位信息</legend>
        <table class="infoTable">
            <tbody>
            <tr>
                <th style="width:10%;">单位名称:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.mainUnit}" name="mainUnit" id="mainUnit" size="50"
                           class="easyui-validatebox"/>
                </td>
                <th style="width:10%;">联系电话:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.unitTel}" name="unitTel" id="unitTel" size="50"
                           class="easyui-validatebox"/>
                </td>
            </tr>
            <tr>
                <th width="10%">单位地址:</th>
                <td>
                    <input type="text" value="${dataSet.unitAddr}" name="unitAddr" id="unitAddr" size="50"
                           class="easyui-validatebox"/>
                </td>
                <th style="width:10%;">技术支持:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.techSupport}" name="techSupport" id="techSupport" size="50"
                           class="easyui-validatebox"/>
                </td>
            </tr>
            </tbody>
        </table>
    </fieldset>
    <fieldset style="width:80%;margin:0 auto;padding: 10px;">
        <legend>系统信息设置</legend>
        <table class="infoTable">
            <tbody>
            <tr>
                <th width="4%">中标公示期:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.publicity}" name="publicity" id="publicity" size="50"
                           maxlength="3" class="easyui-validatebox"/>&nbsp;个工作日
                </td>
                <th width="4%">合同公示期:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.contractPublicity}" name="contractPublicity"
                           id="contractPublicity" size="50" maxlength="3" class="easyui-validatebox"/>&nbsp;个工作日
                </td>
            </tr>
            <tr>
                <th width="4%">流标公示期:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.flowPublicity}" name="flowPublicity" id="flowPublicity"
                           size="50"
                           maxlength="3" class="easyui-validatebox"/>&nbsp;个工作日
                </td>
                <th width="4%">变更公告公示天:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.changePublicity}" name="changePublicity"
                           id="changePublicity" size="50" maxlength="3" class="easyui-validatebox"/>&nbsp;个工作日
                </td>
            </tr>
            <tr>
                <th width="4%">竞拍公告公示期:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.auctionPublicity}" name="auctionPublicity" id="auctionPublicity"
                           size="50"
                           maxlength="3" class="easyui-validatebox"/>&nbsp;个工作日
                </td>
                <th width="4%">产权人确认结果超时时间:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.auditTimeout}" name="auditTimeout"
                           id="auditTimeout" size="50" maxlength="3" class="easyui-validatebox"/>&nbsp;个工作日
                </td>
            </tr>
            <tr>
                <th width="4%">竞价延时:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.auctionSleep}" name="auctionSleep" id="auctionSleep" size="50"
                           maxlength="5" class="easyui-validatebox"/>&nbsp;单位:秒
                </td>
                <th width="4%">项目审核超时时间:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.projectAuditTimeout}" name="projectAuditTimeout"
                           id="projectAuditTimeout" size="50"
                           maxlength="3" class="easyui-validatebox"/>&nbsp;个工作日
                </td>
            </tr>
            <tr>
                <th width="4%">租赁类最大起拍价格:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.maxPriceRent}" name="maxPriceRent" id="maxPriceRent" size="50"
                            class="easyui-validatebox"/>&nbsp;单位:元
                </td>
                <th width="4%">资产处置类最大起拍价格:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.maxPriceTransfer}" name="maxPriceTransfer"
                           id="maxPriceTransfer" size="50" class="easyui-validatebox"/>&nbsp;单位:元
                </td>
            </tr>
            <tr>
                <th width="4%">是否周一上午开标</th>
				  <td width="40%">
				       是<input type="radio"  name="bidOpeningInTheMonAm" value="true"  id="bidOpeningInTheMonAm1" />
					   否<input type="radio" name="bidOpeningInTheMonAm"  value="false" checked id="bidOpeningInTheMonAm2"/>
				  </td>
            </tr>
            </tbody>
        </table>

    </fieldset>
    <fieldset style="width:80%;margin:0 auto;padding: 10px;">
        <legend>联系方式</legend>
        <table class="infoTable">
            <tbody>
            <tr>
                <th width="4%">保证金咨询：</th>
                <td width="40%">
                    <input type="text" value="${dataSet.depositConsult}" name="depositConsult" id="depositConsult"
                           size="50" class="easyui-validatebox"/>&nbsp;
                </td>
                <th width="4%">办公室电话：</th>
                <td width="40%">
                    <input type="text" value="${dataSet.officePhone}" name="officePhone" id="officePhone" size="50"
                           class="easyui-validatebox"/>&nbsp;
                </td>
            </tr>
            <tr>
                <th width="4%">反馈邮箱:</th>
                <td width="40%" colspan="3">
                    <input type="text" value="${dataSet.couplebackEmail}" name="couplebackEmail" id="couplebackEmail"
                           size="50" class="easyui-validatebox"/>&nbsp;
                </td>
            </tr>
            </tbody>
        </table>
    </fieldset>

    </fieldset>
    <fieldset style="width:80%;margin:0 auto;padding: 10px;">
        <legend>首页浮动窗</legend>
        <table class="infoTable">
            <tbody>
            <tr>
                <th width="4%">首页浮动窗图片:</th>
                <td width="40%">
                    <input name="picUrl" type="hidden" id="picUrl" size="60" value="${dataSet.picUrl}"/>&nbsp;&nbsp;
                    <p style="color: red;">
                        注：图片规格：380x190<br/>
                    </p>
                    <input name="uploadify" type="file" id="picUrl_file" class="upload" size="60"/>&nbsp;&nbsp;
                    <span id="picUrl_div" style="${empty dataSet.picUrl?'display: none':''}">
							<a id="picUrl_pic" target="_blank" class="easyui-linkbutton" plain="true"
                               href="${ctx }/${dataSet.picUrl}">浏览图片</a>&nbsp;&nbsp;&nbsp;&nbsp;
							<a href="javascript:void(0);" id="picUrl_del" class="easyui-linkbutton"
                               plain="true">删除图片</a>
						</span>
                </td>
                <th width="4%">首页浮动窗链接地址:</th>
                <td width="40%">
                    <input type="text" value="${dataSet.adUrl}" name="adUrl" id="adUrl" size="100"
                           class="easyui-validatebox"/>&nbsp;
                </td>
            </tr>
            </tbody>
        </table>
    </fieldset>
    <div style="text-align:center;margin-top:10px;">
        <a href="javascript:void(0);" class="easyui-linkbutton" id="saveBt" onclick="saveData();" plain="true">&nbsp;&nbsp;保存&nbsp;&nbsp;</a>
    </div>
</form>
<script type="text/javascript">


    function saveData() {
        if ($('#addDataSetForm').form('validate')) {
            $.ajax({
                type: "POST",
                timeout: 20000,
                url: $('#addDataSetForm').attr("action"),
                data: $("#addDataSetForm").serialize(),
                success: function (data, res) {
                    var result = $.trim(res.responseText);
                    if (result == "unLogin") {
                        var msn = '' || i18n[''];
                        msn = msn || i18n[result];
                        if (msn != undefined) {
                            $.messager.alert('提示', msn, 'info', function () {
                                top.location = paramObj.ctx + '/login.jsp';
                            });
                            return;
                        }
                    }
                    msn = msn || i18n[data];
                    if (msn == undefined) {
                        $.messager.alert('提示', i18n.serverError, 'info');
                    } else if (msn) {
                        $.messager.alert('提示', msn, 'info', function () {
                            location.href = "${ctx }/framework/dataset/input";
                        });
                    }
                },
                error: function (res) {
                    $.messager.alert('提示', i18n.requestError, 'error');
                }
            });
        }
    }


    $(function () {

        //上传图片
        $(".upload").uploadify({
            'height': 27,// 按钮的高度
            'width': 80,// 按钮的宽度
            'buttonText': '选择附件',// 按钮的文字内容
            'queueID': 'fileQueue',//队列的ID
            'queueSizeLimit': 1,// 附件附列长度
            'swf': '${ctx}/commons/js/uploadify/uploadify.swf',
            'cancelImg': '${ctx}/commons/js/uploadify/uploadify-cancel.png',
            'uploader': '${ctx}/framework/dataset/upload;jsessionid=${pageContext.session.id}',// 上传时请求的后台处理的controller
            'folder': '',// 文件上传存储的目录
            'fileTypeExts': '*.jpg;*.gif;*.png',// 文件的扩展名
            'auto': true,// 文件选中后是否自动提交
            'multi': false,//是否可多选，在弹出的文件选择框中可使用ctrl键一次选择多个文件
            'removeCompleted': true,// 文件上传完毕之后将从上传队列中清除
            'successTimeout': 55555,// 超时时间，这个时间不可用设置太长，在2的32次方以内有效，否则将不会达到异步上传的效果，页面端将不会等待后台返回的结果
            'fileSizeLimit': '${webData.imageSize}MB',
            'onUploadSuccess': function (file, data, response) {
                var json = $.parseJSON(data);
                //alert(json.id == '');
                if (json.id != '') {
                    $("#picUrl").val(json.resId);
                    top.$.messager.alert(
                        "提示",
                        '上传成功!',
                        'info',
                        function () {
                            $('#picUrl_div').show();
                            $('#picUrl_pic').attr('href', '${ctx }/file_resource/dataset/' + json.id + json.exeName);
                            $('#picUrl').val('file_resource/dataset/' + json.id + json.exeName);
                        });

                } else {
                    top.$.messager.alert("提示", '上传失败!', 'info');
                }
            }

        });

        //删除
        $("#picUrl_del").click(function () {
            $('#picUrl_div').hide();
            $('#picUrl').val("");
        });

    });


    //是否周一上午开标显示
    $(function () {
        bidOpeningInTheMonAm();
    });

    function bidOpeningInTheMonAm() {

        if ("${dataSet.bidOpeningInTheMonAm}" == "true") {
            $("#bidOpeningInTheMonAm1").attr("checked", true);
        }

        if ("${dataSet.bidOpeningInTheMonAm}" == "false") {
            $("#bidOpeningInTheMonAm2").attr("checked", true);
        }
    }

</script>
</body>
</html>
